package com.ysx.article.controller;


import com.ysx.article.pojo.ApAuthor;
import com.ysx.article.service.ApAuthorService;
import com.ysx.core.controller.AbstractCoreController;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* <p>
* APP文章作者信息表 控制器</p>
* @author ljh
* @since 2021-09-08
*/
@Api(value="APP文章作者信息表",tags = "ApAuthorController")
@RestController
@RequestMapping("/apAuthor")
public class ApAuthorController extends AbstractCoreController<ApAuthor> {

    private ApAuthorService apAuthorService;

    //注入
    @Autowired
    public ApAuthorController(ApAuthorService apAuthorService) {
        super(apAuthorService);
        this.apAuthorService=apAuthorService;
    }
    //根据用户id查询作者账号
    @GetMapping("/one/{userId}")
    public ApAuthor selectByUserId(@PathVariable(value = "userId")Integer userId) {
        return apAuthorService.selectByUserId(userId);
    }
}

